<script type="text/javascript" language="javascript"
	src="com.javandad.app.Chat/com.javandad.app.Chat.nocache.js">
</script>

<%@page import="com.javandad.app.server.db.DatabaseManager"%>
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="java.util.List"%>
<%@page import="com.javandad.app.server.entity.Fodo"%>
<%@page import="com.javandad.app.server.db.PMFSingleton"%>
<%@page import="com.javandad.app.shared.entity.User"%>


<%
	PersistenceManager pm = PMFSingleton.getPM();
	User view = DatabaseManager.getDefaultDatabaseManager().getUser(
			request.getParameter("view"), pm);
	User user = (User) session.getAttribute("user");
	String codesvrParam = (String) request.getParameter("codesvrParam");
	String viewParams = (String) request.getParameter("viewParams");
	if (view == null)
		view = user;

	if (view != null) {
%>


<table border=0 height="100%">
	<tr>
		<td height="100%" bgcolor='edecf6' width='200' valign='top'>
		<table width='100%'
			height="<%=((user != null)
						&& user.getUsername().equals(view.getUsername()) ? 360
						: 300)%>"
			border="0">

			<tr>
				<td height=200>
				<%
					String src;
						List<Fodo> fodos = DatabaseManager.getDefaultDatabaseManager()
								.getFodos(view.getUsername(), null, Fodo.PROFILE_FODO,
										PMFSingleton.getPM());

						if (fodos == null || fodos.size() < 1) {
							src = "img/profile_default_pic.png";
						} else {
							src = "/image?id=" + fodos.get(0).getId();

						}
				%> <img border="0" src="<%=src%>" alt height=200
					width=200 /></td>
			</tr>
			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/home.png" /></td>
						<td><a href="home.jsp?<%=viewParams%>">Home</a></td>
					</tr>
				</table>
			</tr>
			</td>
			<%
				if ((user != null)
							&& user.getUsername().equals(view.getUsername())) {
			%>
			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/messagebox.png" /><a
							href="messagebox.jsp?<%=codesvrParam%>">Message Box</a></td>
					</tr>
				</table>
				</td>
			</tr>
			<%
				}
			%>
			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/resume.png" /><a
							href="resume.jsp?<%=viewParams%>">Resume</a></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/fodos.png" /><a
							href="fodos.jsp?<%=viewParams%>">Photos &amp; Document Scans</a></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/projects.png" /><a
							href="projects.jsp?<%=viewParams%>">Projects</a></td>
					</tr>
				</table>
				</td>
			</tr>
<!--			<tr>-->
<!--				<td>-->
<!--				<table>-->
<!--					<tr>-->
<!--						<td><img width=32 height=32 alt=""-->
<!--							src="../img/icons/papers.png" /><a-->
<!--							href="projects.jsp?<%=viewParams%>">Papers</a></td>-->
<!--					</tr>-->
<!--				</table>-->
<!--				</td>-->
<!--			</tr>-->

			<tr>
				<td>
				<table>
					<tr>
						<td><img width=32 height=32 alt=""
							src="../img/icons/friends_groups.png" /><a
							href="network.jsp?<%=viewParams%>">Friends &amp; Groups</a></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		<%
			}
		%> <b>Friends Online<img width=32 height=32 alt=""
			src="../img/icons/chat.gif" /></b><br />
		<div id="chatContainer"></div>

		</td>
		<td align="top" bgcolor='white'></td>
	</tr>
</table>
